package com.itheima.controller;

import com.itheima.entity.Result;
import com.itheima.entity.StatusCode;
import com.itheima.pojo.User;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;
    @GetMapping("/{id}")
    public Result selectUser(@PathVariable String id){
        User user = userService.selectUser(id);

        return new Result(true, StatusCode.OK,"查询成功",user);
    }
}
